import request from '@/config/axios'

// 字段 VO
export interface ProjectCellTableFieldVO {
  id: number // 编号
  tableId: number // 表id
  name: string // 字段名称
}

// 字段 API
export const ProjectCellTableFieldApi = {
  // 查询字段分页
  getProjectCellTableFieldPage: async (params: any) => {
    return await request.get({ url: `/agent/project-cell-table-field/page`, params })
  },

  // 查询字段详情
  getProjectCellTableField: async (id: number) => {
    return await request.get({ url: `/agent/project-cell-table-field/get?id=` + id })
  },

  // 新增字段
  createProjectCellTableField: async (data: ProjectCellTableFieldVO) => {
    return await request.post({ url: `/agent/project-cell-table-field/create`, data })
  },

  // 修改字段
  updateProjectCellTableField: async (data: ProjectCellTableFieldVO) => {
    return await request.put({ url: `/agent/project-cell-table-field/update`, data })
  },

  // 删除字段
  deleteProjectCellTableField: async (id: number) => {
    return await request.delete({ url: `/agent/project-cell-table-field/delete?id=` + id })
  },

  // 导出字段 Excel
  exportProjectCellTableField: async (params) => {
    return await request.download({ url: `/agent/project-cell-table-field/export-excel`, params })
  },
}